﻿#include<iostream>
using namespace std;

void Swap(int& a, int& b) {
	a = a ^ b;
	b = a ^ b;
	a = a ^ b;
}

void Sort(int ary[], unsigned count, bool BigSort = true) {//默认参数只能放在参数末尾
	for (int i = 1; i < count; i++) {
		for (int i = 1; i < count; i++) {
			bool bcase = BigSort ? ary[i] > ary[i - 1] : ary[i] < ary[i - 1];
			if (bcase) {
				Swap(ary[i], ary[i - 1]);
			}
		}
	}
}
int main() {
	int a[5]{ 123,423,645,184,756 };
	Sort(a, 5, false);
	for (auto x : a)cout << x << endl;
}